/* 
 * File:   itask.h
 * Author: andrey
 *
 * Public interface to engine tasks
 *
 * Created on 12 Январь 2011 г., 15:25
 */

#pragma once

#include <iostream>
#include <windows.h>

class ITask;
typedef ITask* PTask;

class ITask
{
public:
    ITask(){}
    virtual ~ITask(){}
    virtual void* Execute() = 0;

    enum priority{LOW ,NORMAL, HIGH};

    virtual priority GetPriority() = 0;
};



class CXTestTaskN : public ITask
{
public:
    CXTestTaskN()
    {
        pr = NORMAL;
    }
    void* Execute()
    {
		std::cout << "Normal thread working." << std::endl;
		Sleep(500);
        return NULL;
    }
    priority GetPriority()
    {
        return pr;
    }
private:
    ITask::priority pr;
};

class CXTestTaskH : public ITask
{
public:
    CXTestTaskH()
    {
        pr = HIGH;
    }
    void* Execute()
    {
		std::cout << "High thread working." << std::endl;
		Sleep(700);
        return NULL;
    }
    priority GetPriority()
    {
        return pr;
    }
private:
    ITask::priority pr;
};
